<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<div class="aui-header-2 aui-gutter-column-md">
    <h2>{{'common_basic_info_label' | i18n}}</h2>
</div>
<ng-container *ngIf="isCyberEngine; else elseTemplate">
    <div class='aui-gutter-column-xxl'>
        <aui-cyber-summary [source]="source"></aui-cyber-summary>
    </div>
</ng-container>
<ng-template #elseTemplate>
    <div class='aui-gutter-column-xxl'>
        <resoure-base-info [source]="source" [sourceType]="sourceType"></resoure-base-info>
    </div>
</ng-template>

<div class="tabs-table" *ngIf="[dataMap.Resource_Type.NASFileSystem.value].includes(sourceType)">
    <lv-tabs [lvType]="'underline'">
        <lv-tab lvTitle="{{'protection_file_system_info_label'| i18n}}" [lvId]="'fileSystem'">
            <lv-pro-table #fileSystemTable [config]="fileSystemConfig" [data]="fileSystemData"></lv-pro-table>
        </lv-tab>
        <lv-tab lvTitle="{{'protection_nfs_shared_info_label'| i18n}}" [lvId]="'nfsShared'">
            <lv-pro-table #nfsSharedTable [config]="nfsSharedConfig" [data]="nfsSharedData"></lv-pro-table>
        </lv-tab>
        <lv-tab lvTitle="{{'protection_cifs_shared_info_label'| i18n}}" [lvId]="'cifsShared'">
            <lv-pro-table #cifsSharedTable [config]="cifsSharedConfig" [data]="cifsSharedData"></lv-pro-table>
        </lv-tab>
    </lv-tabs>
</div>

<ng-container *ngIf="[dataMap.Resource_Type.LocalFileSystem.value].includes(sourceType) && !isCyberEngine">
    <div class='aui-header-2 aui-gutter-column-md'>
        <h2>{{'protection_nfs_shared_info_label' | i18n}}</h2>
    </div>
    <div class="aui-gutter-column-md">
        <lv-pro-table #nfsSharedTable [config]="nfsSharedConfig" [data]="nfsSharedData"></lv-pro-table>
    </div>
</ng-container>


<ng-template #capacityTpl let-item>
    <span lv-overflow>
        {{item.capacity/2 | capacityCalculateLabel:'1.3-3':unitconst.KB: true}}
    </span>
</ng-template>

<ng-template #usedCapacityTpl let-item>
    <span lv-overflow>
        {{item.usedCapacity + '%'}}
    </span>
</ng-template>